#include <iostream>
#include <cstring>
using namespace std;

const int N = 1000010;
bool st[N];
int prime[N];
int n;
int res = 0;

int main()
{
    memset(st, false, sizeof st);
    cin >> n;
    for (int i = 2; i <= n; ++i)
    {
        if (st[i])
            continue;                    //如果到之前被筛了，就直接跳过
        prime[res++] = i;                //如果没有被筛，那么就是质数
        for (int j = 2; j * i <= n; ++j) //接着用质数去筛后面的合数
            st[j * i] = true;
    }
    // for (int i = 0; i < res; ++i)
    //     cout << prime[i] << endl;
    cout << res;
    return 0;
}